let entIndData = {
  enterprise_scale: {
    name: '企业规模',
    data: []
  },
  industry_type: {
    name: '新能源产业链细分',
    data: []
  }
}

//将对象中文键转为英文
function toEnKeys(data, keyMap) {
  return data.map((item) => {
    let obj = {}
    for (let prop in item) {
      if (keyMap.hasOwnProperty(prop)) {
        obj[keyMap[prop]] = item[prop]
      }
    }
    return obj
  })
}
function convertData(data, target) {
  let keyMap = {
    名称: 'name',
    数值: 'value',
    键: 'key'
  }
  let chartData = toEnKeys(data, keyMap)
  target.data = chartData
}

function convertEntIndJson(data) {
  convertData(data['企业规模'], entIndData['enterprise_scale'])
  convertData(data['新能源产业链细分'], entIndData['industry_type'])
  return entIndData
}
export default convertEntIndJson
